<template>
  <div style="width: 100%">
    <h2 v-if="week" style="margin-top: 0">第 {{week}} 周</h2>
    <div class="markdown-body" v-html="content" style="width: 100%;overflow: auto; margin: 10px 0px"></div>
    <p v-for="(item,index) in attachments" :key="item.id">
      附件 {{index+1}}： <a :href="item.url" target="_blank"> {{item.fileName}}</a>
    </p>
    <el-tag v-if="date" type="gray" class="div-margin10">{{date}}</el-tag>
    <el-tag v-if="name" type="primary">{{name}}</el-tag>
  </div>
</template>

<script>
  import {Tag} from  'element-ui';
  import 'mavon-editor/dist/css/index.css'
  export default {
    name: 'post',
    props: {
      week: {
        type: Number,
        default: 0
      },
      content: {
        type: String,
        default: ''
      },
      attachments: {
        type: Array,
        default: ()=>{return []}
      },
      name: {
        type: String,
      },
      date: {
        type: String,
      },
    },
    components: {
      'el-tag': Tag
    },
    data() {
      return {}
    },
    methods: {},
    created() {

    },
    mounted() {
      this.isShowName = true;
    }
  }
</script>

<style>
img{
  width: 70%;
  margin: auto;
}
</style>
